//
//  bottomButton.m
//  CarTown
//
//  Created by xionghao on 15/8/4.
//  Copyright (c) 2015年 熊浩. All rights reserved.
//

#import "bottomButton.h"

@implementation bottomButton

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(void)awakeFromNib{
    self.titleLabel.textAlignment=NSTextAlignmentCenter;
    self.imageView.contentMode=UIViewContentModeScaleAspectFit;
}

-(CGRect)imageRectForContentRect:(CGRect)contentRect{
    CGFloat x=(contentRect.size.width-18)/2;
    CGFloat y=6;
    CGFloat width=18;
    CGFloat height=18;
    return CGRectMake(x, y, width, height);
}
-(CGRect)titleRectForContentRect:(CGRect)contentRect{
    CGFloat x=0;
    CGFloat y=26;
    CGFloat width=contentRect.size.width;
    CGFloat height=18;
    return CGRectMake(x, y, width, height);
}
@end
